import generator from './../generator';
const fs = require('fs');

const path = require('path')

const configPath = {
    out: path.resolve(__dirname, `../../../code-java/`),
    tem: path.resolve(__dirname, '../../../src/tem/java/')
}

export default async function start(datas) {
    datas.forEach(data => {
        data.package = "com.tc.futures.entity"
        generator(data, "entity.java", `entity/${data.UpTableName}.java`, configPath);
        generator(data, "mapper.java", `mapper/${data.UpTableName}.java`, configPath);   
        generator(data, "mapper/rs.java", `rs/${data.UpTableName}.java`, configPath);     
    });
    
}